package com.eendtech.bootpage.fragment_boot;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.eendtech.bootpage.HomeActivity;
import com.eendtech.bootpage.R;

/**
 * Created by Seale on 2018.11.22
 * Author:Seale
 * Function:
 **/
public class BootThree extends Fragment {
    private Context context;
    private Button btn_Start ;
    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        this.context = context;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView(view);
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        //通过参数获取布局并且返回
        View view = inflater.inflate(R.layout.fragment_boot3,null);
        return view ;
    }

    private void initView (View view){
        btn_Start = (Button)view.findViewById(R.id.btn_Start);
        btn_Start.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity().getApplicationContext(),HomeActivity.class);
                startActivity(intent);
            }
        });
    }
}
